<h3>selected object options</h3>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'objects-form',
	'enableAjaxValidation'=>false,
        )
); ?>
<div id="floatingbar">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'ui-button ui-widget ui-state-default ui-corner-all','style'=>'width:120px')); ?>
</div>
    
    <?php echo $form->errorSummary($model); ?>

    <fieldset class="box">
        <legend>Basic</legend>
        <table>
            <tr class="row">
                <td width="170px">
                    <?php echo $form->labelEx($model,'name'); ?>
                </td>
                <td>
                    <?php echo $form->textField($model,'name',array('size'=>30,'maxlength'=>100)); ?>
                    <?php echo $form->error($model,'name'); ?>
                </td>
            </tr>
            <tr class="row">
                <td>
                    <?php echo $form->labelEx($model,'description'); ?>
                </td>
                <td>
                    <?php echo $form->textArea($model,'description',array('rows'=>3, 'cols'=>40)); ?>
                    <?php echo $form->error($model,'description'); ?>
                </td>
            </tr>
            <tr class="row">
                <td>
                    <?php echo $form->labelEx($model,'org_id'); ?>
                </td>
                <td>
                    <?php

                    $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                       //'model'=>$model,
                       'name'=>'org_id',
                       'value'=>CHtml::encode(Organisation::model()->findByPK($model->org_id)->nachname),
                       'source' => $this->createUrl('Organisation/autocompleteOrganisation'),
                       'options' => array(
                            'minLength'=>'2',
                            'select'=>"js:function(event,ui){
                                $('#".CHtml::activeId($model,'org_id')."').val(ui.item.id);
                            }",
                       ),
                    ));

                    ?>

                    <?php echo $form->hiddenField($model,'org_id'); ?>
                    <?php echo $form->error($model,'org_id'); ?>

                    
                </td>
            </tr>
         </table>
    </fieldset>
            
   <fieldset class="box">
        <legend>Preload/Load Options</legend>
        <table>
            <tr class="row">
                <td>Object Handling:</td>
                <td colspan="3">
                    <?php echo $form->dropdownList($model,'type',array('1'=>'Refresh','2'=>'Revision'),array(
                                    'style'=>'width:250px',
                                )); ?>
                    <?php echo $form->error($model,'type'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $form->labelEx($model,'s_format'); ?> (* only Revision)
                </td>
                <td>                 
                    <?php echo $form->dropdownList($model,'s_format',array('1'=>'YYYY','2'=>'YYYY/MM','3'=>'YYYY/MM/DD'),array(
                                    'style'=>'width:150px',
                                )); ?>
                    <?php echo $form->error($model,'s_format'); ?>
                    
                </td>
                <td>
                    Don't refresh before:
                </td>
                <td>
                    <?php echo $form->textField($model,'s_zyklus_start',array('size'=>2,'maxlength'=>2)); ?>
                    <?php echo $form->error($model,'s_zyklus_start'); ?>
                </td>
            </tr>
        </table>
    </fieldset>

    <fieldset class="box">
        <legend>QlikView</legend>
        <table>            
            <tr class="row">
                <td>
                    QlikView Document
                </td>
                <td>
                    <?php
                    
                        $QlikViewDocument = Qvobjects::model()->findAll(array(
                                                        'select'=>'t.qvo_docName',
                                                        'distinct'=>true,
                                                ));
                        $QlikViewDocumentList = CHtml::listData($QlikViewDocument,'qvo_docName','qvo_docName');
                    
                        echo CHtml::dropDownList('qvo_docName','', $QlikViewDocumentList,
                            array(
                                'ajax' => array(
                                        'type'=>'POST', //request type
                                        'url'=>CController::createUrl('objects/dynamicqvobjects'), //url to call.
                                        'update'=>'#qvo_id', //selector to update                                     
                                ),
                                'style'=>'width:350px',
                            )); 
                   
                    ?>
                    <?php echo $form->error($model,'qvo_id'); ?>
                </td>
            </tr>
            <tr>
                <td>QlikView Objects</td>
                <td>
                    <?php                                                                     
                            echo $form->dropdownList($model,'qvo_id',
                                CHtml::listData(Qvobjects::model()->findAll(),'qvo_id','qvo_objectName'),
                                array(
                                    'style'=>'width:350px',
                                )
                            );                   
                    ?>
                </td>
            </tr>
        </table>
    </fieldset>

    <fieldset class="box">
        <legend>Timing</legend>
        <table>
            <tr class="row">
                <td width="170px">
                    <?php echo $form->labelEx($model,'s_zyklus'); ?>
                </td>
                <td>
                    <?php echo $form->dropdownList($model,'s_zyklus',array('1'=>'daily','2'=>'weekly','3'=>'monthly')); ?>
                    <?php echo $form->error($model,'s_zyklus'); ?>                    
                </td>
            </tr>
            <tr class="row">
                <td>
                    <?php echo $form->labelEx($model,'s_zyklus_time'); ?>
                </td>
                <td>
                    <?php
                        $this->widget('application.extensions.timepicker.timepicker',
                            array(
                                'model'=>$model,
                                'name'=>'s_zyklus_time',
                                'options'=>array(
                                    'hourGrid'=>4,
                                    'minuteGrid'=>10
                                )
                            )                            
                        );
                    ?>
                    
                    <?php echo $form->error($model,'s_zyklus_time'); ?>
                </td>
            </tr>
            <tr>
                <td>
                    <?php echo $form->labelEx($model,'s_zyklus_gap'); ?>
                </td>
                <td>
                    <?php
                        echo CHtml::activeCheckBoxList($model,'tblWeekdays',
                                    CHtml::listdata(Weekdays::model()->findAll(),'weekday_id','day'),
                                    array(
                                        'template' => '<div class="check-option">{input} {label}</div>',
                                        'separator' => '',
                                   )
                                );
                    ?>
                    <?php echo $form->error($model,'s_zyklus_gap'); ?>
                </td>
            </tr>
        </table>
    </fieldset>

		<?php echo $form->hiddenField($model,'cdate'); ?>
		<?php echo $form->error($model,'cdate'); ?>


<p class="note">Fields with <span class="required">*</span> are required.</p>

		

<?php $this->endWidget(); ?>

</div><!-- form -->
